package com.mew.chess.core.game.lh.game.task;


import com.mew.chess.core.game.lh.game.LhGameManager;
import com.mew.chess.core.game.lh.game.LhRoomManager;
import com.mew.chess.core.game.lh.game.common.LhConstantValue;
import com.mew.chess.core.game.lh.game.common.LhLinkType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class LhPreparTask {

    public boolean startPrepar(int roomId){
        LhRoomManager roomManager = LhGameManager.getInstance().getController(roomId);

        roomManager.clearPlayInfo();
        roomManager.refreshBigRList();

        roomManager.setLinkType(LhLinkType.Prepare.code());
        roomManager.setStartTime(System.currentTimeMillis());
        roomManager.setRuleTime(LhConstantValue.PREPARE_TIME);

        return true;
    }

}
